package com.ficus.road.maintain.core.model.taskInfo;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author lijiawei
 * @date 2023/10/10 下午3:54
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@AllArgsConstructor
@NoArgsConstructor
public class CDTaskInfoDetail {

    public static final int rejectedState = 3;
    /**
     * 主键
     */
    private String id;

    /**
     * 养护部门
     */
    private String departId;

    /**
     * 工单编号
     */
    private String taskNum;

    /**
     * 操作类型 1. 派单  2. 接受处理  3. 退回申请  4. 结案申请 5. 批注 6. 申请延期
     */
    private Integer status;

    private String imagePath;

    // 退单原因
    @JsonDeserialize(using = ZhongHaiDateDeserializer.class)
    private LocalDateTime createTime;

    private String createBy;

    private String advice;

    public boolean isRejectInfo() {
        return this.getStatus() == rejectedState;
    }
}
